import XLSX from 'xlsx'

/**
 * 导出 xlsx 文件
 * @param {*} list [ { A:"S", B:"h", C:"e", D:"e", E:"t", F:"J", G:"S" } ]
 * @param {*} header ["A","B","C","D","E","F","G"]
 * @param {*} filename 文件名
 */
export function export_xlsx(list, filename){
    let sheet = XLSX.utils.json_to_sheet(list),
      wb = XLSX.utils.book_new()

    XLSX.utils.book_append_sheet(wb, sheet, "order")
    XLSX.writeFile(wb, `${filename}.xlsx`)
}